//
//  STGoodsDetailViewController.m
//  赛拓
//
//  Created by 王磊 on 7/29/16.
//  Copyright © 2016 立金所. All rights reserved.
//

#import "STCommodityDetailViewController.h"
#import "STGoodsTableView.h"
#import "STCommodityBean.h"
@interface STCommodityDetailViewController ()<STBaseViewDelegate>
@property (nonatomic ,strong) STGoodsTableView *tableView;
@end

@implementation STCommodityDetailViewController

- (void)initSubviews {
    [super initSubviews];
    
    STGoodsTableView *tableView = [STGoodsTableView instanceWithFrame:CGRectMake(0, 0, ST_SCREEN_WIDTH, CGRectGetHeight(self.view.bounds) - 48)];
    
    self.tableView = tableView;
    
    tableView.cellType = STCellTypeGoods;
    
    tableView.mDelegate = self;
    
    [self.view addSubview:tableView];
    
}



- (void)loadData {
    [super loadData];
    
    self.loadingView.loadingStatus = BDLoadingStatusSuccess;
    
    NSDictionary *json = @{
                           @"imgUrl":@"http://7xwkri.com2.z0.glb.qiniucdn.com/p1.png",
                           @"name":@"高岭土",
                           @"price":@"18",
                           @"type":@"",
                           @"cid":@"",
                           @"cName":@"4-氨基－5-氯嘧啶",
                           @"enName":@"4-Amino-5-chloropyrimidine",
                           @"cas":@"101257-82-3",
                           @"molecular":@"C4H4C1N3",
                           @"molWeight":@"1111",
                           @"weight":@"111",
                           @"pas":@"231",
                           @"logp":@"1231231",
                           @"des":@"化学忘的差不多了",
                           @"company":@"山东立金所"
                           };
    
    STCommodityBean *goodsBean = [STCommodityBean mj_objectWithKeyValues:json];
    
    [self.tableView updateHeader:goodsBean];
    
    [self.tableView updateData:goodsBean];
}
- (void)onItemClick:(STItemClickType)itemType withData:(id)data forIndexPath:(NSIndexPath *)indexPath {
    
    
}
@end
